import QtQuick 2.12
import QtQuick.Controls 2.12

QtObject {
    id: commonStyles
    
    // 颜色定义
    readonly property color primaryColor: "#3498db"
    readonly property color primaryDarkColor: "#2980b9"
    readonly property color successColor: "#27ae60"
    readonly property color successDarkColor: "#229954"
    readonly property color warningColor: "#f39c12"
    readonly property color warningDarkColor: "#e67e22"
    readonly property color dangerColor: "#e74c3c"
    readonly property color dangerDarkColor: "#c0392b"
    readonly property color infoColor: "#17a2b8"
    readonly property color infoDarkColor: "#138496"
    readonly property color secondaryColor: "#6c757d"
    readonly property color secondaryDarkColor: "#5a6268"
    readonly property color lightColor: "#ecf0f1"
    readonly property color lightDarkColor: "#bdc3c7"
    readonly property color backgroundColor: "#f8f9fa"
    readonly property color borderColor: "#dee2e6"
    readonly property color whiteColor: "#ffffff"
    readonly property color transparentColor: "transparent"
    
    // 按钮样式
    property Component primaryButton: Rectangle {
        color: commonStyles.primaryColor
        border.color: commonStyles.primaryDarkColor
        radius: 6
    }
    
    property Component successButton: Rectangle {
        color: commonStyles.successColor
        border.color: commonStyles.successDarkColor
        radius: 6
    }
    
    property Component warningButton: Rectangle {
        color: commonStyles.warningColor
        border.color: commonStyles.warningDarkColor
        radius: 6
    }
    
    property Component dangerButton: Rectangle {
        color: commonStyles.dangerColor
        border.color: commonStyles.dangerDarkColor
        radius: 6
    }
    
    property Component secondaryButton: Rectangle {
        color: commonStyles.secondaryColor
        border.color: commonStyles.secondaryDarkColor
        radius: 6
    }
    
    property Component lightButton: Rectangle {
        color: commonStyles.lightColor
        border.color: commonStyles.lightDarkColor
        radius: 6
    }
    
    // 输入框样式
    property Component inputField: Rectangle {
        color: commonStyles.whiteColor
        border.color: commonStyles.borderColor
        border.width: 1
        radius: 4
    }
    
    // 卡片样式
    property Component card: Rectangle {
        color: commonStyles.whiteColor
        border.color: commonStyles.borderColor
        border.width: 1
        radius: 8
    }
    
    // 面板样式
    property Component panel: Rectangle {
        color: commonStyles.backgroundColor
        border.color: commonStyles.borderColor
        border.width: 1
        radius: 8
    }
    
    // 分隔线样式
    property Component separator: Rectangle {
        color: commonStyles.borderColor
        height: 1
    }
    
    // 状态指示器样式
    property Component statusIndicator: Rectangle {
        width: 8
        height: 8
        radius: 4
    }
    
    // 全屏按钮样式
    property Component fullscreenButton: Rectangle {
        color: parent.pressed ? Qt.rgba(255, 255, 255, 0.3) : Qt.rgba(255, 255, 255, 0.1)
        radius: 16
    }
}
